<!--
	作者：956911785@qq.com
	时间：2019年8月13日11:13:39
	描述：积分商城商品-添加
-->

<template>
	<Tcontent ref="Tcontent" :teas="params" :title="title" @addsave="addsave"></Tcontent>
</template>

<script>
	import Tcontent from "./Tcontent";
	export default {
		name:"addJfsc",
		props: {
    	},
		data() {
			return {
				params:{
					spid:"", 
					spname:"", 
					allnum:"", 
					needjf:"", 
					spurl:"", 
					ydh:"", 
				},
				title:'新增商品'
			}
		},
		components: {
			Tcontent
		},
		methods: {
			addsave:function(datas){
				const da={...datas};
				const params={
					spname:da.spname, 
					allnum:da.allnum, 
					needjf:da.needjf, 
					spurl:da.spurl, 
					ydh:"0", 
				};
                this.$http.post("/host/readbook/jfsc/add_jfsc.html",params)
				.then(result => {
					if(result){
						this.$Modal.success({
                            title: "提示",
                            content: "添加成功！"
                       });
                       this.$emit("reload");
                       this.$refs.Tcontent.closeModal();
					}else{
						this.$Modal.error({
                            title: "提示",
                            content: "添加失败，请联系管理员！"
                       });	
					}
				});
	        },
			openmodal(){
				this.$refs.Tcontent.modal0 = true;
			}
		},
		mounted() {

		},
		watch:{
			
		}
	}
</script>

<style scoped="scoped">
	
</style>



